package fi.helsinki.cs.ohtu10k.schedule;

import org.joda.time.DateTime;
import org.joda.time.Duration;


/**
 * Factory class for ScheduleEvents.
 * @author Thomas Nyman
 * @author Jani Rönkä
 *
 */
public final class ScheduleEventFactory {
	
	/**
	 * Constructs new ScheduleEvent with the specified properties.
	 * @param startDate		Start date of event.
	 * @param duration		Duration of event.
	 * @param name			Name of Event.
	 * @param course		Course event belongs to. 
	 * @param isNotifiable	True if user should be notified of this event. 
	 * @return New ScheduleEvent with the specified properties.
	 * @throws IllegalArgumentException
	 */
	public static ScheduleEvent getScheduleEvent(DateTime startDate, Duration duration, 
												 String name, ScheduleCourse course, 
		 										 boolean isNotifiable) throws IllegalArgumentException {
		
		return new PeriodEvent(startDate, duration, name, course, isNotifiable);
	}
	
	/**
	 * Constructs new ScheduleEvent with the specified properties.
	 * @param startDate		Start date of event.
	 * @param duration		Duration of event.
	 * @param name			Name of Event.
	 * @param isNotifiable	True if user should be notified of this event. 
	 * @return New ScheduleEvent with the specified properties.
	 * @throws IllegalArgumentException
	 */
	public static ScheduleEvent getScheduleEvent(DateTime startDate, Duration duration, 
			 									 String name, boolean isNotifiable) throws IllegalArgumentException {

		return new PeriodEvent(startDate, duration, name, null, isNotifiable);
	}
	
}
